package com.flash.javamate;

import com.flash.javamate.handler.FindTextHandler;
import com.flash.javamate.utils.SearchFileUtils;

import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

/**
 * @author sunyiming
 * @date 2018/8/10
 */
public class SearchFileMain {

    public static void main(String[] args) throws IOException {
        Set<String> set = generageList();
        File file = new File("E:\\moviebar\\web-front\\customer-fe");
        SearchFileUtils.findTextAndPrintLine(file, new FindTextHandler() {
            @Override
            public boolean isMatch(String line) {
                /*for (String s : set) {
                    if (line.contains(s)) {
                        return true;
                    }
                }
                return false;*/
                return line.contains("apis");
            }

            @Override
            public void formatPrint(String line, File file) {
                String print = String.format("%s【%s】", line,"file.getAbsolutePath()");
                System.out.println(print);
            }
        });
    }

    public static Set<String> generageList() {
        Set<String> list = new HashSet<>();
        list.add("api/album/list");
        list.add("api/album/preview");
        list.add("api/album/albumEpisodeList");
        list.add("api/album/download");
        list.add("api/album/delete");
        list.add("api/album/channelInfo");
        list.add("api/bar/initialBar");
        list.add("api/bar/handleDebugRequest");
        list.add("api/bar/getBarInfo");
        list.add("api/bar/getBarBriefInfo");
        list.add("api/bar/getBarAuth");
        list.add("api/bar/getBarCinemaInfo");
        list.add("api/bar/getBarHotCity");
        list.add("api/bar/getBarAgentId");
        list.add("api/bar/sendAlert");
        list.add("api/bar/noticeVersion");
        list.add("api/cinema/delete");
        list.add("api/copyright/isEpisodeAvailable");
        list.add("api/device/keepServerAlive");
        list.add("api/device/registLocal");
        list.add("api/device/delete");
        list.add("api/device/healthCallback");
        list.add("api/device/listVideoIds");
        list.add("api/device/listFormatsByVideoId");
        list.add("api/device/topicList");
        list.add("api/device/topicInfo");
        list.add("api/device/getListForSDK");
        list.add("api/episode/pullEpisode");
        list.add("api/episode/getImage");
        list.add("api/idx/query");
        list.add("api/init/label");
        list.add("api/init/allBarsLabel");
        list.add("api/init/pullLabelInfo");
        list.add("api/magicBlock/getById");
        list.add("api/preorder/h5/create");
        list.add("api/preorder/h5/my");
        list.add("api/preorder/h5/unplaycount");
        list.add("api/preorder/h5/cancel");
        list.add("api/preorder/local/receive");
        list.add("api/preorder/local/refuse");
        list.add("api/subAccount/getAuthCookie");
        list.add("api/subAccount/logOut");
        list.add("api/third/qrcoder");
        list.add("api/third/deviceCommand");
        list.add("api/third/productList");
        list.add("api/third/orders");
        list.add("api/vip/registVip");
        list.add("api/vip/syncBaseInfo");
        list.add("api/vip/syncAccountInfo");
        list.add("api/external/getPackageEpisode");
        list.add("api/external/getEpisodeInfo");
        list.add("api/external/reportSessionData");
        list.add("api/initEpisode");
        list.add("api/initAlbum");
        list.add("api/initEpisodeByPull");
        list.add("api/initAlbumByPull");
        list.add("api/init/qipuIdsForEpisode");
        list.add("api/init/qipuIdsForAlbum");
        list.add("api/init/serviceType");
        list.add("api/local/account/info");
        list.add("api/local/account/charge/details");
        list.add("api/local/account/chargeAndRecharge/details");
        list.add("api/receivePing");
        list.add("localBar/lastestPing");
        list.add("api/fromLocal/episodeList");
        list.add("api/fromLocal/episodeAlbumList");
        list.add("api/fromLocal/episodeInfo");
        list.add("api/fromLocal/downloadEpisode");
        list.add("api/fromLocal/deleteEpisode");
        list.add("api/fromLocal/deleteEpisodes");
        list.add("api/fromLocal/pullEpisodes");
        list.add("api/fromLocal/pullCleanEpisodes");
        list.add("api/getFormatUrl");
        list.add("api/getFormatInfoByBar");
        list.add("api/pullFromCloud");
        list.add("api/pushToCloud");
        list.add("api/device/register");
        list.add("api/device/sdkRegister");
        list.add("api/pc/regist");
        list.add("api/vr/register");
        list.add("api/statistic/comsume/table");
        list.add("api/statistic/order/table");
        list.add("api/statistic/pay/table");
        list.add("api/statistic/play/bar");
        list.add("api/statistic/play/channel");
        list.add("api/statistic/preorder/date");
        list.add("api/bar/taskStatusChanged");
        list.add("api/h5/vr/orderAuth");
        list.add("api/h5/vr/tradeInfo");
        list.add("api/h5/vr/createAndPayOrder");
        list.add("api/h5/vr/orderList");
        list.add("api/h5/vr/orderInfo");
        list.add("api/h5/vr/payResult");
        list.add("api/h5/vr/payNotify");
        list.add("api/h5/vr/getOpenId");
        list.add("api/yk/orderAuth");
        list.add("api/yk/getOpenId");
        list.add("api/yk/orderInfo");
        list.add("api/yk/tradeInfo");
        list.add("api/yk/changeDevice");
        list.add("api/yk/wechatpay");
        list.add("api/yk/alipay");
        list.add("api/yk/payResult");
        list.add("api/yk/orderList");
        list.add("api/yk/payNotify");
        list.add("api/yk/playNow");
        list.add("api/pc/qrcoder");
        list.add("api/pc/playAuth");
        list.add("api/pc/priceInfo");
        list.add("api/pc/roomCommand");
        list.add("api/pc/topicList");
        list.add("api/pc/topicList/v1");
        list.add("agent/agentTwo/add");
        list.add("agent/agentTwo/edit");
        list.add("agent/agentTwo/findAgentList");
        list.add("agent/agentTwo/getAgent");
        list.add("agent/bar/save");
        list.add("agent/bar/validateArguments");
        list.add("agent/bar/update");
        list.add("agent/bar/preview");
        list.add("agent/bar/getBusinessBarRefList");
        list.add("agent/bar/listMerchant");
        list.add("agent/bar/bindUid");
        list.add("agent/index");
        list.add("agent/notice/save");
        list.add("agent/notice/delete");
        list.add("agent/notice/latest");
        list.add("agent/notice/latestNotice");
        list.add("agent/notice/latestAccountNotice");
        list.add("agent/notice/list");
        list.add("agent/operlog/list");
        list.add("agent/statistic/business/globalInfo");
        list.add("agent/statistic/business/detailInfo");
        list.add("agent/validate/barbelongAgent");
        list.add("agent/validate/agentbelongChannel");
        list.add("agent/ybChannelAccount/chargingList");
        list.add("agent/ybChannelAccount/detailChargingList");
        list.add("agent/ybChannelAccount/accountBalance");
        list.add("agent/ybChannelAccount/applyRecharge");
        list.add("agent/ybChannelAccount/rechargeList");
        list.add("agent/ykChannelAccount/dailyList");
        list.add("agent/ykChannelAccount/detailList");
        list.add("agent/ykChannelAccount/accountBalance");
        list.add("agent/ykChannelAccount/applyWithdraw");
        list.add("agent/ykChannelAccount/withdrawList");
        list.add("agent/ykorder/queryForAgent");
        list.add("activity/add");
        list.add("activitylist");
        list.add("activity/getType");
        list.add("activity/getValidServiceType");
        list.add("activity/getValidEntity");
        list.add("activity/getAgent");
        list.add("activity/setAgent");
        list.add("agentBalance/record/list/detail");
        list.add("agentBalance/relation/add");
        list.add("agentBalance/relation/delete");
        list.add("agentBalance/relation/list");
        list.add("agentOne/add");
        list.add("agentOne/edit");
        list.add("agentOne/findAgentList");
        list.add("agentOne/getAgent");
        list.add("agentOne/getAgentTest");
        list.add("agentOne/getFormatTypeList");
        list.add("agentOne/setChannelAccount");
        list.add("agentOne/firstRechargePreview");
        list.add("agentOne/setPackage");
        list.add("agentTwo/add");
        list.add("agentTwo/edit");
        list.add("agentTwo/findAgentList");
        list.add("agentTwo/getAgent");
        list.add("album/list");
        list.add("album/preview");
        list.add("album/delete");
        list.add("album/changeOnlineStatus");
        list.add("album/dispatch");
        list.add("album/addToPackage");
        list.add("album/deleteFromPackage");
        list.add("album/albumEpisodeList");
        list.add("album/albumEpisodeDetail");
        list.add("album/addEmailNotice");
        list.add("album/updateEmailNotice");
        list.add("album/offlineEmailNotice");
        list.add("album/clear");
        list.add("album/viewEmailNotice");
        list.add("albumclean");
        list.add("album/getAlbumInfo");
        list.add("albumHistory/getOperateTypeRelation");
        list.add("albumHistory/getAlbumOperateList");
        list.add("album/release/summaryList");
        list.add("album/release/detailList");
        list.add("album/release/retry");
        list.add("album/release/checkprocedure");
        list.add("area/provinceList");
        list.add("area/cityList");
        list.add("area/allCityList");
        list.add("agentTwoAudit/pass");
        list.add("agentTwoAudit/passNot");
        list.add("agentTwoAudit/findFirstList");
        list.add("agentTwoAudit/findSecondList");
        list.add("barAudit/pass");
        list.add("barAudit/passNot");
        list.add("barAudit/getBarRefList");
        list.add("accountAudit/pass");
        list.add("accountAudit/notPass");
        list.add("accountAudit/auditList");
        list.add("debugAudit/barList");
        list.add("debugAudit/pass");
        list.add("debugAudit/passNot");
        list.add("agentOneAuth/grant");
        list.add("agentOneAuth/edit/revoke");
        list.add("agentOneAuth/revoke");
        list.add("agentTwoAuth/grant");
        list.add("agentTwoAuth/revoke");
        list.add("account/recharge");
        list.add("accountpay/payNotify");
        list.add("bar/update");
        list.add("bar/editAuthStatus");
        list.add("bar/recoverService");
        list.add("bar/getBarAndAgentTotal");
        list.add("bar/preview");
        list.add("bar/renew");
        list.add("bar/extendAuthorize");
        list.add("bar/authList");
        list.add("bar/getBusinessBarRefList");
        list.add("bar/getBarRefList");
        list.add("bar/exceptionBar");
        list.add("bar/listMerchant");
        list.add("barclose/{barId}");
        list.add("bar/release/summaryList");
        list.add("businessPrice/list");
        list.add("businessPrice/setPrice");
        list.add("businessPrice/cinemaCount");
        list.add("statistic/business/totalInfo");
        list.add("statistic/business/rowData");
        list.add("category");
        list.add("api/pushCategory");
        list.add("api/localGetCloudCategory");
        list.add("api/pushSingleCategory");
        list.add("category/refreshToBar");
        list.add("distribution/episode/operlog");
        list.add("distribution/album/operlog");
        list.add("episode/addEpisodesToPackage");
        list.add("episode/addEpisodeToPackages");
        list.add("episode/deleteEpisodesFromPackage");
        list.add("episode/deleteEpisodeFromPackages");
        list.add("episode/changePackages");
        list.add("episode/deleteEpisodePackageRelations");
        list.add("episode/packageRelationAdd");
        list.add("episode/packageRelationDelete");
        list.add("cloud/label/{groupId}");
        list.add("localEpisode/list");
        list.add("localEpisode/online");
        list.add("localEpisode/offline");
        list.add("localEpisode/episode");
        list.add("operateLog/list");
        list.add("cloud/package/add");
        list.add("cloud/package/edit");
        list.add("cloud/package/list");
        list.add("cloud/package/selectlist");
        list.add("cloud/package/listByBusinessType/{businessType}");
        list.add("userMessage/send");
        list.add("userMessage/retry");
        list.add("userMessage/list");
        list.add("userMessage/messageType");
        list.add("commissionsPercent/list");
        list.add("commissionsPercent/setPercent");
        list.add("commissionsPercent/historyPercent");
        list.add("copyright/getBarCopyrightRelation");
        list.add("copyright/getFilterCopyrights");
        list.add("copyright/addBarCopyrightRelation");
        list.add("copyright/deleteBarCopyrightRelation");
        list.add("device/unbindServer");
        list.add("device/unbindDevice");
        list.add("device/refreshPc");
        list.add("device/getServerDevice");
        list.add("cloud/entityType/add");
        list.add("cloud/entityType/selectlist");
        list.add("cloud/entityType/list");
        list.add("cloud/entityType/byBusinessType/{businessType}");
        list.add("episode/release/summaryList");
        list.add("episode/release/detailList");
        list.add("episode/release/retry");
        list.add("episode/count");
        list.add("episode/abnormalBarList");
        list.add("episode/completeDistribute");
        list.add("bar/singleHome");
        list.add("episode/release/checkprocedure");
        list.add("episodeHistory/getFormatTypeRelation");
        list.add("episodeHistory/getStatusRelation");
        list.add("episodeHistory/getOperateTypeRelation");
        list.add("episodeHistory/getEpisodeOperateList");
        list.add("episodeHistory/getFormatDistributeList");
        list.add("episode/findEpisodeList");
        list.add("episode/getEpisodeInfo");
        list.add("episode/updateEpisodeOpinion");
        list.add("episode/getEpisodeFormatInfo");
        list.add("episodePrice/list");
        list.add("episodePrice/setPrice");
        list.add("episodePrice/setFree");
        list.add("episodePrice/unFree");
        list.add("es/createStorage");
        list.add("es/statistic/createMapping");
        list.add("es/statistic/createChannelPlayDataMapping");
        list.add("es/updAlias");
        list.add("es/deleteAllData");
        list.add("es/deleteById");
        list.add("es/refreshClient");
        list.add("es/statistic/writeAllData");
        list.add("es/statistic/writeDailyData");
        list.add("es/statistic/writeDailyChannelPlayData");
        list.add("es/episode/writeAllData");
        list.add("es/bar/writeAllData");
        list.add("es/agent/writeAllData");
        list.add("es/album/writeAllData");
        list.add("api/log/uploadLog");
        list.add("api/log/instantCollect");
        list.add("log/restartMonitor");
        list.add("log/queueDetail");
        list.add("magicBlock/queryList");
        list.add("magicBlock/save");
        list.add("magicBlock/getBlockInfoById");
        list.add("magicBlock/delete");
        list.add("magicContent/save");
        list.add("magicContent/getById");
        list.add("magicContent/delete");
        list.add("magicContent/changeStatus");
        list.add("magicContent/changeShowOrder");
        list.add("api/release/getToken");
        list.add("api/release/getCopyToken");
        list.add("release/episodesAndBars");
        list.add("release/episodeFormat");
        list.add("release/episodes");
        list.add("release/cancel");
        list.add("api/alive");
        list.add("release/allBarsEpisodesByBarId");
        list.add("release/allBarsEpisodes");
        list.add("cloud/product/add");
        list.add("cloud/product/edit");
        list.add("cloud/product/get");
        list.add("cloud/product/getDetailsById");
        list.add("cloud/provider/add");
        list.add("cloud/provider/edit");
        list.add("cloud/provider/get");
        list.add("cloud/provider/getDetailsById");
        list.add("cloud/provider/getListsByServiceType");
        list.add("cloud/serviceType/byBusiness/{businessType}");
        list.add("cloud/serviceType/byEntity/{entityType}");
        list.add("cloud/serviceType/byAgent/{agentId}");
        list.add("soft/save");
        list.add("soft/pushSoftVersionInfoToLocal");
        list.add("soft/pushToSelectLocalBars");
        list.add("api/soft/pushSoftVersionInfoToSingleLocalBar");
        list.add("soft/softVersionList");
        list.add("soft/softVersionConfig");
        list.add("soft/barListToPushForSoftVersion");
        list.add("soft/getBeenPushed");
        list.add("soft/getNotBeenPushed");
        list.add("soft/getLatestSoftVersionInfo");
        list.add("soft/getSoftUpgradeInfo");
        list.add("soft/pushSmartToSelectLocalBars");
        list.add("soft/refreshBatchForHistoryVersion");
        list.add("soft/softVersion/pushData");
        list.add("soft/upgradeConfigList");
        list.add("soft/configVersionUpgradeTime");
        list.add("statistic/consume/recover");
        list.add("statistic/hour/hourInfo");
        list.add("statistic/order/recover");
        list.add("statistic/order/sumInfo");
        list.add("statistic/order/charData");
        list.add("statistic/order/rowData");
        list.add("statistic/pay/recover");
        list.add("statistic/playrecord/sumInfo");
        list.add("statistic/playrecord/charData");
        list.add("statistic/playrecord/rowData");
        list.add("statistic/cloud/recoverData");
        list.add("statistic/cloud/recoverDataFromLocal");
        list.add("statistic/cloud/episodeRank");
        list.add("statistic/cloud/globalInfo");
        list.add("statistic/cloud/globalInfo/excel");
        list.add("statistic/cloud/ykGlobalInfo/excel");
        list.add("statistic/cloud/ykGlobalInfo");
        list.add("statistic/cloud/detailInfo");
        list.add("statistic/cloud/parentOrderList");
        list.add("statistic/cloud/childOrderList");
        list.add("statistic/cloud/childOrderSelect");
        list.add("statistic/cloud/albumRank");
        list.add("statistic/cloud/excelHourData");
        list.add("statistic/rechargeDetailsList");
        list.add("statistic/reduceDetailsList");
        list.add("suggest/episode");
        list.add("suggest/topic");
        list.add("suggest/bar");
        list.add("suggest/agent");
        list.add("suggest/album");
        list.add("suggest/dataReport/bar");
        list.add("suggest/dataReport/episode");
        list.add("{/api/test1}");
        list.add("{/api/test2}");
        list.add("{/api/test3}");
        list.add("vip/listVip");
        list.add("vip/listVipAccount");
        list.add("bar/auth/delayAuthList");
        list.add("bar/auth/delayAuth");
        list.add("ybCharging/chargingList");
        list.add("ybCharging/detailChargingList");
        list.add("ybCharging/summary");
        list.add("bar/ybPay/payFlowList");
        list.add("bar/ybPay/payFlow");
        list.add("ybSettlement/dailyList");
        list.add("ybSettlement/detailList");
        list.add("ybSettlement/summary");
        list.add("ybSettlement/doSettlement");
        list.add("ykorder/query");
        list.add("ykorder/querySelect");
        list.add("ykSettlement/dailyList");
        list.add("ykSettlement/detailList");
        list.add("ykSettlement/summary");
        list.add("ykSettlement/doSettlement");
        list.add("ykSettlement/devideYkOrderIncome");
        list.add("topic/list");
        list.add("topic/save");
        list.add("topic/topicInfo");
        list.add("topic/getByTopicId");
        list.add("topic/episodeList");
        list.add("topic/episodeInfoByQipuId");
        list.add("topic/episodeInfoById");
        list.add("topic/episodeSave");
        list.add("topic/episodeDelete");
        list.add("topic/activate");
        list.add("topic/enable");
        list.add("topic/disable");
        list.add("topic/copyTopic");
        list.add("topic/listTopicByTime");
        list.add("topic/changeTopicOrder");
        list.add("topic/changeTopicEpisodeOrder");
        list.add("topic/delete");
        list.add("cloud/mq/publishTopic");
        list.add("task/status");
        list.add("task/createTaskTask");
        list.add("cache/guava/clean");
        list.add("cache/couchbase/clean");
        list.add("cache/couchbase/clearBar");
        list.add("cache/couchbase/clearAll");
        list.add("cache/couchbase/get");
        list.add("command/sendCommand");
        list.add("command/sendCommandToAll");
        list.add("command/get");
        list.add("command/sendBusinessCommand");
        list.add("constant/editSwitch");
        list.add("manual/index/pushIndex");
        list.add("manual/index/getAndPushIndex");
        list.add("firstLetter/remake");
        list.add("freeDisk/findAndDispatchEpisodes");
        list.add("manual/magicContent/refreshCache");
        list.add("parent_order/update_userid");
        list.add("property/getCloudProp");
        list.add("property/refresh");
        list.add("api/send/barInfo");
        list.add("api/lego/receive/qipuId");
        list.add("api/lego/pullAll");
        list.add("api/lego/pullSingleEpisode");
        list.add("api/lego/pullMoviebarEpisodes");
        list.add("api/lego/pullMoviebarAlbums");
        list.add("api/lego/pullMoviebarAlbum");
        list.add("manual/search/rebuildIndex");
        list.add("syncEpisode/queryDiff");
        list.add("syncEpisode/syncToLocalWithQipuIds");
        list.add("syncEpisode/syncEpisodesOfSingleBar");
        list.add("syncInfo");
        list.add("syncInfo/syncLatestData");
        return list;
    }

}
